<template>
<div class="">
    <p>
        <span class="tit1">养老补贴发放金额统计图</span>
    </p>
    <div ref="chart2" class='top20' style="width: 100%; height: 400px" />
</div>
</template>

<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
export default {
    components: {},
    props: {},
    data() {
        return {
            chartData: {
                data1: ['已发放补贴（万元）', '未发放补贴（万元）'],
                data2: [{value: 33, name: '已发放补贴（万元）'},{value: 22, name: '未发放补贴（万元）'}],
                data3: [],
            }
        }
    },
    computed: {},
    watch: {

    },
    created() {
        const t = this;

    },
    mounted() {
        const t = this;
        t.initChart();
    },
    methods: {
        initChart() {
            this.chart = echarts.init(this.$refs.chart2, 'macarons')
            this.setOptions()
        },
        setOptions() {
            const t = this;
            this.chart.setOption({
                tooltip: {
                    trigger: 'item',
                    formatter: '{b} : {c} ({d}%)'
                },
                legend: {
                    bottom: 0,
                    data: t.chartData.data1
                },
                color: ['#FFAE38','#FF5B50', '#56D756','#C38DFF','#4E7FE6'],
                series: [{
                    type: 'pie',
                    center: ['50%', '50%'],
                    data: t.chartData.data2,
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }]
            })
        }
    }
}
</script>

<style lang="scss" scoped>
</style>
